package com.example.leetcode.backtrace;

import com.example.leetcode.backtrace.common.BackTraceUtils;

class Solution79 {
    public boolean exist(char[][] board, String word) {
        return BackTraceUtils.exist(board, word);
    }
}

public class leetcode79 {
    public static void main(String[] args) {
        Solution79 solution79 = new Solution79();
        char[][] board = {{'A','B','C','E'},{'S','F','C','S'},{'A','D','E','E'}};
        String word = "ABCCED";
        System.out.println(solution79.exist(board, word));

        char[][] board1 = {{'A','B','C','E'},{'S','F','C','S'},{'A','D','E','E'}};
        String word1 = "SEE";
        System.out.println(solution79.exist(board1, word1));

        char[][] board2 = {{'A','B','C','E'},{'S','F','C','S'},{'A','D','E','E'}};
        String word2 = "ABCB";
        System.out.println(solution79.exist(board2, word2));
    }
}
